import React from 'react';

export class Item extends React.Component {
  constructor() {
    super();
    this.state = {
      count: 0,
    };
  }

  render() {
    return (
      <div
        onClick={() =>
          this.setState({
            count: this.state.count + 1,
          })
        }
        style={{ border: '1px solid red' }}
      >
        <h2>我是一个自定义组件</h2>
        <h3>我被点击了{this.state.count}</h3>
      </div>
    );
  }
}
